package com.fstrat.frontend.webserviceclient;

import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;

import com.fstrat.backend.entities.User;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.core.util.MultivaluedMapImpl;


public class UserClient {

	public static User login(String email, String passwort){
		MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
		queryParams.add("benutzername", email);
		queryParams.add("passwort", passwort);
		WebResource webResource = WebResourceFactory.getUserInstance();
		User user = webResource.queryParams(queryParams)
									.accept(MediaType.APPLICATION_JSON_TYPE)
									.post(User.class);
		return user;
	}
	
}
